<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:68:"E:\WWW\zhihui\public/../application/home\view\cate\index_userup.html";i:1528965703;s:62:"E:\WWW\zhihui\public/../application/home\view\public\base.html";i:1529389343;}*/ ?>
<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/reset.css"/>
	<link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/style.css"/>
	<link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/foundation-datepicker.css"/>
	<link rel="stylesheet" type="text/css" href="__ROOT__/static/home/css/font-awesome.css"/>
	<script src="__ROOT__/static/home/js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
	<title></title>
</head>


<body>
<div class="bj">
	<audio id="mp3" src="__ROOT__/static/home/remind.mp3"> </audio>
	<!--头部-->
	
	<div class="head">
		<div class="h-top">
			<ul>
				<li><a href="#"></a><span></span></li>
				<li><a href="#"></a><span></span></li>
				<li><a href="#"></a><span></span></li>
				<li><a href="#"></a></li>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="h-name">
			<div class="name">
				<div class="logo left">
					<a href="#"><img src="__ROOT__/static/home/img/logo.png" style="height: 40px;"/></a>
				</div>
				<div class="assistant right">
					<div class="img">
						<img src="__ROOT__/static/home/img/assistant.png"/>
					</div>
					<div class="b-div">
						<img src="__ROOT__/static/home/img/assistant.png"/>
						<p class="t2 open-wing"><a>修改密码</a></p>
						<p class="t2"><a href="<?php echo URL('business/index'); ?>">账号设置</a></p>
						<p class="t2"><a href="<?php echo URL('index/quitLogin'); ?>">退出登录</a></p>
					</div>
				</div>

			</div>
		</div>
	</div>
	
	<!--内容-->
	<div class="c">
		<div class="content">
			
			<div class="c-l left">
				<div class="c-left">
					<div class="list">
						<div class="">
							<i></i><span>统计分析</span>
						</div>
						<ul>
							<li><a href="<?php echo URL('index/index'); ?>">概况分析</a></li>
							<li><a href="<?php echo URL('index/user'); ?>">用户分析</a></li>

						</ul>

					</div>



					<div class="list">
						<div class="">
							<i></i><span>图片管理</span>
						</div>
						<ul>
							<li><a href="<?php echo URL('banner/index'); ?>">图片管理</a></li>
						</ul>

					</div>

					<div class="list">
						<div class="">
							<i></i><span>信息管理</span>
						</div>
						<ul>
							<li><a href="<?php echo URL('commtype/index'); ?>">分类管理</a></li>
							<li><a href="<?php echo URL('message/index'); ?>">信息展示管理</a></li>
							<!-- <li><a href="<?php echo URL('freight/index'); ?>">运费模板管理</a></li> -->

						</ul>
					</div>

					<div class="list">
						<div class="">
							<i></i><span>会员管理</span>
						</div>
						<ul>
							<li><a href="<?php echo URL('user/index'); ?>">会员列表</a></li>
							<li><a href="<?php echo URL('user/indexs'); ?>">刚刚访问用户</a></li>
						</ul>
					</div>

					<div class="list">
						<div class="">
							<i></i><span>订单管理</span>
						</div>
						<ul>
							<li><a href="<?php echo URL('order/index'); ?>">待付款</a></li>
							<li><a href="<?php echo URL('order/delivergoods'); ?>">待发货</a></li>
							<li><a href="<?php echo URL('order/takegoods'); ?>">待收货</a></li>
							<li><a href="<?php echo URL('order/complete'); ?>">已完成</a></li>

							<li><a href="<?php echo URL('order/occlude'); ?>">已关闭</a></li>

						</ul>

					</div>

					<div class="list">
						<div class="">
							<i></i><span>资产管理</span>
						</div>
						<ul>
							<li><a href="<?php echo URL('record/index'); ?>">交易记录</a></li>
						</ul>
					</div>
					<div class="list">
						<div class="">
							<i></i><span>产品管理</span>
						</div>
						<ul>
							<li><a href="<?php echo URL('cate/index'); ?>">产品分类管理</a></li>
							<li><a href="<?php echo URL('cate/get_goods'); ?>">产品管理</a></li>
							<li><a href="<?php echo URL('cate/get_store'); ?>">门店管理</a></li>
							<li><a href="<?php echo URL('cate/get_user'); ?>">会员管理</a></li>
							<li><a href="<?php echo URL('cate/get_userup'); ?>">会员等级</a></li>
							<li><a href="<?php echo URL('cate/get_coupon'); ?>">优惠券管理</a></li>
						</ul>
					</div>
					<!--<div class="list">-->
						<!--<div class="">-->
							<!--<i></i><span>优惠券</span>-->
						<!--</div>-->
						<!--<ul>-->
							<!--<li><a href="<?php echo URL('coupon/index'); ?>">优惠券列表</a></li>-->


						<!--</ul>-->
					<!--</div>-->
					<!--<div class="list">-->
						<!--<div class="">-->
							<!--<i></i><span>评论管理</span>-->
						<!--</div>-->
						<!--<ul>-->
							<!--<li><a href="<?php echo URL('comment/index'); ?>">评论列表</a></li>-->


						<!--</ul>-->
					<!--</div>-->

					<div class="list">
						<div class="">
							<i></i><span>基本设置</span>
						</div>
						<ul>
							<!--<li><a href="">基本设置</a></li>-->
							<li><a href="<?php echo URL('express/index'); ?>">快递设置</a></li>

							<li><a href="<?php echo URL('payments/index'); ?>">支付设置</a></li>

							<li><a href="<?php echo URL('business/index'); ?>">商家基本信息</a></li>
							<!--<li><a href="">管理员信息</a></li>-->
						</ul>
					</div>
					<div class="list">
						<div class="">
							<a href="<?php echo URL('payments/buss'); ?>"><i></i><span>店铺管理</span></a>
						</div>
						<!--<ul>-->
							<!--&lt;!&ndash;<li><a href="">基本设置</a></li>&ndash;&gt;-->
							<!--<li><a href="<?php echo URL('express/index'); ?>">快递设置</a></li>-->

							<!--<li><a href="<?php echo URL('payments/index'); ?>">支付设置</a></li>-->

							<!--<li><a href="<?php echo URL('business/index'); ?>">商家基本信息</a></li>-->
							<!--&lt;!&ndash;<li><a href="">管理员信息</a></li>&ndash;&gt;-->
						<!--</ul>-->
					</div>

				</div>

			</div>

			<!--<div id="main" style="width: 600px;height:400px;"></div>-->
			
			

			<input type="hidden" name="mun_url" id="mun_url" value="8,4"/><style>	.c .c-r .label-3 .Tab table td img{		width:12px;height: 12px}	.c .c-r .label-3 table .two{display: none;color: #009900;background: #F5F7F9;}	.c .c-r .label-3 table .two td:nth-child(2){text-align: left;}	.c .c-r .label-3 table .two .sublevel{margin: 0 0 0 20px}	.c .c-r .label-3 table .three{display: none;color: #009900;background: #e8eef3;}	.c .c-r .label-3 table .three td:nth-child(2){text-align: left;}	.c .c-r .label-3 table .three .sublevel{margin: 0 0 0 30px}	.c .c-r .label-3 .Tab table .tab_imgurl img{width:60px;height: 60px;}</style><div class="c-r right">	<div class="label1">		<div class="title">			产品管理		</div>		<div class="label-3 label">			<div class="Statistics">				<div class="clear"></div>			</div>			<div class="Tab Tabs">				<table border="0" cellspacing="0" cellpadding="0" style="width: 984px;">					<tr>						<th style="width: 200px;">会员id</th>						<th style="width: 200px;">门店名称</th>					</tr>				</table>				<table border="0" cellspacing="0" cellpadding="0" style="width: 984px;" class="tabdiv">					<?php if(is_array($data) || $data instanceof \think\Collection || $data instanceof \think\Paginator): $k = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?>					<tbody class="ass">					<tr  class="one" data-type=''>						<td style="width: 200px;"><?php echo $vo['id']; ?></td>						<td style="width: 200px;"><?php echo $vo['level_name']; ?></td>					</tr>					</tbody>					<?php endforeach; endif; else: echo "" ;endif; ?>				</table>			</div>		</div>	</div></div><script src="../../static/home/js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script><script src="../../static/home/js/js.js" type="text/javascript" charset="utf-8"></script><script type="text/javascript">    $(document).on("click", ".Iimg_tow", function(){        var src = $(this).attr('src')        var srcshow = "__STATIC__/home/img/show.gif"		//显示图片地址        var srchide = "__STATIC__/home/img/hide.gif"		//隐藏图片地址        var index = $(this).parent().parent().attr('data-i');        var tr = $(this).parent().parent().parent()        if (src == srchide) {            $(this).attr('src',srcshow)            tr.find('.three').hide()        }else{            $(this).attr('src',srchide)            for (var i = 0; i < tr.find('.three').length; i++) {                tr.find('.three').eq(i).hide()                if(tr.find('.three').eq(i).attr('data-i') == index){                    console.log(i,'----------')                    tr.find('.three').eq(i).show()                }            }        }    })    $(document).on("click", ".Iimg", function(){        var src = $(this).attr('src')        var srcshow = "__STATIC__/home/img/show.gif"		//显示图片地址        var srchide = "__STATIC__/home/img/hide.gif"		//隐藏图片地址        var img_this = $(this)        var superior = img_this.parent().parent().parent()        var one = img_this.parent().parent().attr('class')		//一级        superior.find('.two').show()        if (src == srcshow) {            $(this).attr("src",srchide)            if (one == 'one') {                console.log(superior.attr('class'))                superior.find('.two').show()            }        }else{            $(this).attr("src",srcshow)            if (one == 'one'){                superior.find('.two').hide()                superior.find('.three').hide()                $('.Iimg_tow').attr('src',srcshow)            }        }    })    // 添加一级    $(document).on("click", ".form_fl button", function(){        var inpval = $(this).parents('form').find('input').eq(0).val()        if (inpval == '') {            prompt('请先填写分类名',0)            return false;        }else{        }    })    // 添加二级    $(document).on("click", ".form_fltow button", function(){        var inpval = $(this).parents('form').find('input').eq(0).val()        var upval = $(this).parents('.ass').find('input').eq(0).val()        var pid = $(this).parents('.ass').find('.one .pid').text()        alert(upval +'------------'+pid)        if (upval == '' || pid == ''){            prompt('请先提交一级分类',0)            return false;        }        if (inpval == ''){            prompt('请先填写分类名',0)            return false;        }    })    //	function Preservation_three(e){    ////		alert('111')    ////		return false;    //		var inpval = e.parents('tr').find('td').eq(1).find('input').val()    //			if (inpval == '') {    //				prompt('请先填写分类名',0)    //				return false;    //			}    //	}    //更改图片地址    //$(".Iimg").click(function(){    // $(document).on("click", ".Iimg_two", function(){    // 	var src = $(this).attr('src')    // 	var srcshow = "../../static/home/img/show.gif"		//显示图片地址    // 	var srchide = "../../static/home/img/hide.gif"		//隐藏图片地址    // 	var one_type = $(this).parents('tr').attr('data-type')		//==="1-2-3"    // 	var two_type = $(this).parents('.ass').find('.three')		  //.attr('data-type')    // 	for (var i = 0; i < two_type.length; i++) {    // 		if (src == srchide) {    // 			if (two_type.eq(i).attr("data-type").substring(0,1) == one_type.substring(0,1) && two_type.eq(i).attr("data-type").substring(2,3) == one_type.substring(2,3)) {    // 				two_type.eq(i).show()    // 			} else{    // 				two_type.eq(i).hide()    // 			}    // 		}else{    // 			two_type.eq(i).hide()    // 		}    //    // 	}    // })    var are = '';					  //一级    var are_two = '';				//二级    var are_three = '';			//三级    $.ajax({        type:"get",        url:"__publicPath__/home/commtype/ajaxindex",        data: '',        dataType: "json",        success: function(data){            for (var i = 0; i < data.length; i++){      //一级分类                var urls = "'editsolt'";                var edit = "'edit'";                are = '<tbody class="ass"><tr class="one" data-type='+data[i].rank+'><td style="width: 40px;"><img src="../../static/home/img/show.gif" class="Iimg"></td><td style="width: 218px;"><input type="text" name="" id="" value='+data[i].name+' onblur="upajax('+data[i].tid+','+urls+',this,0)" disabled="disabled"></td><td class="pid" style="width: 65px;">' + data[i].tid                    + '<td style="width: 100px;" class ="tab_imgurl"><img src="' +data[i].logo+                    '"/></td><td style="width: 190px;">'+data[i].updatetime+'</td><td style="width: 94px;"><b class='+data[i].sclass+'>'+data[i].statuss+'</b></td>'                    + '<td style="width: 94px;"><input type="text" name="" id="" value='+data[i].solt+' style="width: 50px;" onblur="upajax('+data[i].tid+','+urls+',this,0)"></td><td>' +                    '<button class="modifybtn ml" onclick="compilest('+data[i].tid+','+edit+',0)">编辑</button><button class='+data[i].oclass+'  onclick="shelvese('+data[i].tid+','+data[i].status+')">'+data[i].operate+'</button>' +                    '</td></tr></tbody>';//					Level = data[i].level                $(".tabdiv").append(are)                //console.log(i+'级')                for (var j = 0; j < data[i].sub.length; j++){                    //console.log(i)                    are_two = '<tr class="two" data-type='+data[i].sub[j].rank+'><td><img src="../../static/home/img/show.gif" class="Iimg Iimg_two"></td><td><i class="sublevel"></i><input type="text" name="" id="" value='+data[i].sub[j].name+' onblur="upajax('+data[i].sub[j].ptid+','+urls+',this,1)" disabled="disabled"></td><td class="pid">' + data[i].sub[j].ptid                        + '<td style="width: 100px;" class ="tab_imgurl"><img src="' +data[i].sub[j].pic                        + '"/></td><td>'+data[i].sub[j].updatetime+'</td><td><b class='+data[i].sub[j].sclass+'>'+data[i].sub[j].statuss+'</b></td>'                        + '<td><input type="text" name="" id="" value='+data[i].sub[j].solt+' style="width: 50px;" onblur="upajax('+data[i].sub[j].ptid+','+urls+',this,1)"></td><td>' +                        '<button class="modifybtn ml" onclick="compilest('+data[i].sub[j].ptid+','+edit+',1)">编辑</button><button class='+data[i].sub[j].oclass+' onclick="shelves('+data[i].sub[j].ptid+','+data[i].sub[j].status+')">'+data[i].sub[j].operate+'</button></td></tr>';                    $(".ass").eq(i).append(are_two)                    //console.log(data[i].sub[j].sub.length)                    for (var v = 0; v < data[i].sub[j].sub.length; v++) {                        are_three = '<tr class="three" data-type='+data[i].sub[j].sub[v].rank+'><td></td><td><i class="sublevel"></i><input type="text" name="" id="" value='+data[i].sub[j].sub[v].name+' onblur="upajax('+data[i].sub[j].sub[v].ptid+','+urls+',this,1)" disabled="disabled"></td><td class="pid">' + data[i].sub[j].sub[v].ptid                            + '<td style="width: 100px;" class ="tab_imgurl"><img src="' +data[i].sub[j].sub[v].pic                            + '"/></td><td>'+data[i].sub[j].sub[v].updatetime+'</td><td><b class='+data[i].sub[j].sub[v].sclass+'>'+data[i].sub[j].sub[v].statuss+'</b></td>'                            + '<td><input type="text" name="" id="" value='+data[i].sub[j].sub[v].solt+' style="width: 50px;" onblur="upajax('+data[i].sub[j].sub[v].ptid+','+urls+',this,1)"></td><td>' +                            '<button class="modifybtn ml" onclick="compilest('+data[i].sub[j].sub[v].ptid+','+edit+',1)">编辑</button><button class='+data[i].sub[j].sub[v].oclass+' onclick="shelves('+data[i].sub[j].sub[v].ptid+','+data[i].sub[j].sub[v].status+')">'+data[i].sub[j].sub[v].operate+'</button></td></tr>';                        $(".ass").eq(i).find('.two').eq(j).after(are_three)                    }                }            }            //console.log(are)            //$(".tabdiv").append("<tbody class='oneadd'><tr class='onebtn'><td colspan='10'><button class='onebtn_add'>添加一级分类分类</button></td></tr></tbody>")            //$(".ass").append("<tr class='twobtn'><td colspan='10'><button class='twobtn_add'>添加二级分类分类</button></td></tr>")        },        error:function(){            alert('失败')        }    });    //保存上传    function Preservation(e){        var inpval = e.parents('tr').find('td').eq(1).find('input').val()        if (inpval == '') {            prompt('请先填写分类名',0)            return false;        }    }    //保存上传    function Preservation_two(e){        var ase = e.parents('.ass').find('.one td').eq(1).find('input').val()        var inpval = e.parents('tr').find('td').eq(1).find('input').val()        var pid = e.parents('.ass').find('.one .pid').text()        if (ase == '' || pid == '') {            prompt('请先提交一级分类',0)            return false;        }        if(inpval == ''){            prompt('请先填写分类名',0)            return false;        }else{            var data = {id:pid}            $.ajax({                type:"get",                url:"data/select.json",                data: data,                dataType: "json",                success: function(data){                    window.location.reload();                },                error:function(){                    alert('失败')                }            });        }    }    function compilest(id,url,v) {        window.location.href=url+"?id="+id+"&v="+v;    }    //上下架    function shelves(ptid,v){        $("#tan").remove();        var htmls = "<div id='tan'><span class='spanbj'></span><div class='tan'><div class='tit_p'>提示</div><div class='p_body'>是否确认操作？</div><div class='btn-b'><span class='cancel span-hide'>取消</span><span class='modifybtn span-que'>确定</span><div class='clear'></div></div></div></div>"        $("body").append(htmls);        $(document).on("click", ".span-que", function(){            $("#tan").remove();            var data = {                status:v,ptid:ptid            };            $.ajax({                type:"get",                data: data,                url:"__publicPath__/home/commtype/soldOut",			//请求地址加参数                dataType: "json",                success: function(data){                    if (data == 1) {                        prompt('关闭成功',data)                        window.location.reload();                    } else{                        prompt('关闭失败',data)                        //window.location.reload();                    }                },                error:function(){                    prompt('操作失败',0)                }            });        })        $(document).on("click", ".span-hide", function(){            $("#tan").remove();        })    }    function shelvese(tid,v){        $("#tan").remove();        var htmls = "<div id='tan'><span class='spanbj'></span><div class='tan'><div class='tit_p'>提示</div><div class='p_body'>是否确认操作？</div><div class='btn-b'><span class='cancel span-hide'>取消</span><span class='modifybtn span-que'>确定</span><div class='clear'></div></div></div></div>"        $("body").append(htmls);        $(document).on("click", ".span-que", function(){            $("#tan").remove();            var data = {                tid:tid,status:v            };            $.ajax({                type:"get",                data: data,                url:"__publicPath__/home/commtype/soldOut",			//请求地址加参数                dataType: "json",                success: function(data){                    if (data == 1) {                        prompt('关闭成功',data)                        window.location.reload();                    } else{                        prompt('关闭失败',data)                        //window.location.reload();                    }                },                error:function(){                    prompt('操作失败',0)                }            });        })        $(document).on("click", ".span-hide", function(){            $("#tan").remove();        })    }</script>
			<!--<div id="main" style="width: 600px;height:400px;"></div>-->
		</div>

	</div>

	<!--尾部-->
	
	<div class="foot">
		Copyright © 2016 - 2017 qingful.com All Rights Reserved
	</div>
	
	<!--返回顶部-->


</div>

<script src="__ROOT__/static/home/js/js.js" type="text/javascript" charset="utf-8"></script>
<script src="../../static/home/js/pagination.min.js" type="text/javascript" charset="utf-8"></script>
<script>
    //索引0开始
    var mun_url = $('#mun_url').val();											//获取页面参数
    var arrmun_url = mun_url.split(",")				                           //转成数组格式
    var leftul = $(".c .c-l .list ul").eq(arrmun_url[0]).find('li').length		//获取元素数量
    $(".c .c-l .list ul").eq(arrmun_url[0]).css('height',50*leftul)				//设置高度
    $(".c .c-l .list ul").eq(arrmun_url[0]).find('li').eq(arrmun_url[1]).attr('class','act')//添加样式
//    function myFunction(){
        // setInterval(function () {
        //     $.ajax({
        //         url:"<?php echo url('index/send'); ?>",
        //         dataType:'json',
        //         success:function (data) {
        //             if(data.res == 1){
        //                 $('#mp3')[0].play();
        //             }
        //         },
        //     })
        // },10000)

        var modify = '<div id="wrap" class="modifys"><div class="wrap-body modify"><div class="title">修改密码</div><form action="/home/index/regpwd" method="post" id="modify">'+
            '<div class=""><label>输入旧密码：</label><input type="password" name="oldpwd" id="oldpwd" value="" onblur="upmodifys(this)"/></div>'+
            '<div class=""><label>设置新密码：</label><input type="password" name="pwd" id="pwd" value="" /></div>'+
            '<div class=""><label>确认新密码：</label><input type="password" name="upwd" id="upwd" value="" /></div><div class="sub"><input type="button" value="确认" class="sub"/></div>'+
            '</form><span class="close-wrap close-wing">×</span></div></div>'
        $("body").append(modify);
    //    var urlform = "<?php echo url('index/pwd'); ?>"
    //    $("#modify").attr("action",urlform)
    var Submit = true;
	$('.close-wing').click(function () {
		$('.modifys').fadeOut()
    })
    function regular(regular,j,txt) {
        var mail = regular;
        var j = $("#"+j).val()
        //alert(j)
        if (j == '' || j == null) {
            prompt("密码不可为空",0)
            return false;
        }
        if(mail.test(j)){
            //console.log('正确')
        }else{
            prompt(txt,0)
            //console.log('错误')
            return false;
        }
        return true
    }
    function upmodifys(o){
        var val = $(o).val()
        if (val == '' || val == null) {
            prompt("请输入旧密码",0)
            //Submit = false;
        } else{
            $.ajax({
                type:"post",
                url:"<?php echo url('index/pwd'); ?>",
                data:{
                    date:val
                },
                success:function(data){
                    //console.log(data)
                    if (data == 1) {
                        Submit = true;
                    } else{
                        prompt("旧密码输入错误",0)
                        Submit = false;
                    }
                }
            });
        }
    }
    var name_regular = /^[A-Za-z0-9]{4,40}$/     //姓名验证

    $('#modify .sub input').click(function () {
        var oldpwd = $("#oldpwd").val()
        var pwd = $('#pwd').val()
        var pwds = $('#upwd').val()
        if(oldpwd == "" || oldpwd == null){
            prompt("请输入旧密码",0)
            return false;
        }

        if (Submit == false) {
            prompt("旧密码输入错误",0)
            return false;
        }
        if(oldpwd == pwd){
            prompt("旧密码不能与新密码相同",0)
            return false;
        }
        if (!regular(name_regular,'oldpwd','旧密码格式错误') || !regular(name_regular,'pwd','新密码格式错误')) {
            return false
        }else if(pwds == '' || pwds == null){
            prompt("请再次输入密码",0)
            return false;
        }
        if (pwds != pwd) {
            prompt("密码输入不统一",0)
            return false;
        }
        $.ajax({
            type:"post",
            url:"<?php echo url('index/regpwd'); ?>",
            data:{
                pwd:pwd
            },
            success:function(data){
                window.location.reload()
            }
        });
    })
</script>
</body>
</html>








